<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script type="text/javascript" src="<?=JS_PATH?>jquery.min.js"></script>
       <script src="<?=ASSETS?>time/js/foundation-datepicker.js" type="text/javascript"></script>
    <script src="<?=ASSETS?>time/js/foundation-datepicker.zh-CN.js" type="text/javascript"></script>

    <link href="<?=ASSETS?>time/css/foundation-datepicker.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="<?=ASSETS?>bootstrap/bootstrap.min.css" />
    <title>文章列表</title>
</head>
<script>

    $(function(){

       $("#show_all").click(function(){

          location.href="<?=web_url('myself/log',true)?>";
       });

    });

</script>
<body>
<div class="container" style="margin-top: 3%">

    <div class="row">

        <div class="col-lg-7" style="margin-left: -12px;">

            <div class="form-group form-inline">
                <form action="<?=web_url('myself/logtime',true)?>"  method="post">
                <input type="hidden" name="form" value="1"/>
                <label>起始时间&nbsp;</label>
                <input name="start_time" id="start_time" type="text" class="form-control input-sm"/>
                <label>起始时间&nbsp;</label>
                <input name="end_time" id="end_time" type="text" class="form-control input-sm"/>
                <button type="submit" class="btn btn-primary btn-sm">查询</button>
                    <button id="show_all" type="button" class="btn col-lg-offset-1 btn-primary btn-sm">显示全部</button>
                </form>
            </div>

        </div>

        <div class="col-lg-3 col-lg-offset-2">
            <div class="form-group form-inline">
                <form action="<?=web_url('myself/logkey',true)?>" method="post">
                    <input type="hidden" name="form" value="2"/>
                <input name="key_word" type="text" placeholder="ip地址" class="form-control input-sm"/>&nbsp;
                <button type="submit" class="btn btn-primary btn-sm">搜索</button>
                </form>
            </div>
        </div>

    </div>


    <div class="row" style="margin-top: 10px;">

        <div class="table">

            <table class="table table-responsive table-hover table-condensed">

                <thead>

                <tr>
                    <th>编号</th>
                    <th>登录ip</th>
                    <th>所属区域</th>
                    <th>操作时间</th>
                    <th>事件名称</th>
                </tr>

                </thead>

                <tbody>
                <?php foreach ($logs as $log):?>
                <tr>
                    <td><?=$log->id?></td>
                    <td><?=$log->ip_addr?></td>
                    <td><?=$log->login_address?></td>
                    <td><?=$log->ctime?></td>
                    <td><?=$log->event_name?></td>
                </tr>
                <?php endforeach;?>
                </tbody>

            </table>


        </div>
        <div class="col-lg-offset-9">
            <?=$links?>
        </div>


    </div>


</div>
<script>

    $(function(){

        $("#start_time").fdatepicker({
            format: 'yyyy-mm-dd hh:ii:ss',
            pickTime: true,
            startDate:'1890-1-1',
            endDate:new Date()
        });

        $("#end_time").fdatepicker({
            format: 'yyyy-mm-dd hh:ii:ss',
            pickTime: true,
            startDate:'1890-1-1',
            endDate:new Date()
        });

    });

</script>

</body>
</html>
